package com.future.common.global;

import com.corundumstudio.socketio.SocketIOServer;
import com.future.model.SysUser;

public class PlatFormContext {
	// 当前登录的用户信息
	private static final ThreadLocal<SysUser> currentUser = new ThreadLocal<SysUser>();
	// 请求是否来自mobile
	private static final ThreadLocal<Boolean> fromMobile = new ThreadLocal<Boolean>();
	//socketio server
	private static SocketIOServer server;
	
	public static SysUser getCurrentUser() {
		return currentUser.get();
	}

	public static void setCurrentUser(SysUser user) {
		currentUser.set(user);
	}

	public static SocketIOServer getServer() {
		return server;
	}

	public static void setServer(SocketIOServer server) {
		PlatFormContext.server = server;
	}
	public static Boolean getFromMobile() {
		return fromMobile.get();
	}

	public static void setFromMobile(Boolean fromMobile) {
		PlatFormContext.fromMobile.set(fromMobile);
	}
}
